the preparation method is to add a proper amount of magnesium chips and solvent into the reaction kettle, add a small amount of chloropropene dropwise at room temperature to initiate the reaction, after the reaction starts, add a mixture of 5-methylfurfural and chloropropene dropwise into the reaction solution, keep the temperature for 1h after dropping, add the above reactant and an appropriate amount of dilute sulfuric acid into the corresponding water at the same time, stir for hydrolysis, and the pH of the water layer is 4~5, after the reaction is completed, the oil layer is separated, the water layer is extracted with solvent, the oil layer is merged, the solvent is heated and recovered, and the product is distilled under reduced pressure.